-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ndt_scan_matcher): estimate NDT covariance in real-time with limited initial positions #5338
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for creating the PR. I found a risky code in a brief review. Please check.
Initialize Eigen::Vector2d Co-authored-by: Kento Yabuuchi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thank you for the PR 🎉
Left some minor comments so please check 🙏
@@ -141,6 +141,15 @@ NDTScanMatcher::NDTScanMatcher() | |||
initial_pose_distance_tolerance_m_ = | |||
this->declare_parameter<double>("initial_pose_distance_tolerance_m"); | |||
|
|||
use_cov_estimation_ = this->declare_parameter("use_covariance_estimation", use_cov_estimation_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not use the default parameter and instead do as follow
use_cov_estimation_ = this->declare_parameter("use_covariance_estimation", use_cov_estimation_); | |
use_cov_estimation_ = this->declare_parameter<bool>("use_covariance_estimation"); |
// covariance estimation | ||
std::array<double, 36> ndt_covariance; | ||
ndt_covariance = output_pose_covariance_; | ||
if (is_converged && use_cov_estimation_) { | ||
estimate_covariance(ndt_result, initial_pose_matrix, ndt_covariance, sensor_ros_time); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this part is relatively computationally heavy, so I would recommend to move this right after the following part:
// perform ndt scan matching
(*state_ptr_)["state"] = "Aligning";
const Eigen::Matrix4f initial_pose_matrix =
pose_to_matrix4f(interpolator.get_current_pose().pose.pose);
auto output_cloud = std::make_shared<pcl::PointCloud<PointSource>>();
ndt_ptr_->align(*output_cloud, initial_pose_matrix);
const pclomp::NdtResult ndt_result = ndt_ptr_->getResult();
(*state_ptr_)["state"] = "Sleeping
This will also enable users to monitor the total execution time with exe_time
as well.
@KOKIAOKI Thank you for your contribution! |
Thank you for checking my implementation. |
Signed-off-by: Koki Aoki <[email protected]>
I tested the fixed source code. It worked fine in my environment. Here are the corrections
I will resolve the confliction later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some comments. Please check it out 🙏
localization/ndt_scan_matcher/config/ndt_scan_matcher.param.yaml
Outdated
Show resolved
Hide resolved
… process Signed-off-by: Koki Aoki <[email protected]>
Signed-off-by: Koki Aoki <[email protected]>
Sorry for the delay in reporting.
Thank you for further reviewing! |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #5338 +/- ##
==========================================
+ Coverage 14.84% 15.09% +0.24%
==========================================
Files 1665 1661 -4
Lines 116231 115372 -859
Branches 36256 35646 -610
==========================================
+ Hits 17259 17419 +160
+ Misses 79473 78436 -1037
- Partials 19499 19517 +18
*This pull request uses carry forward flags. Click here to find out more.
☔ View full report in Codecov by Sentry. |
@YamatoAndo @KYabuuchi |
localization/localization_util/include/localization_util/util_func.hpp
Outdated
Show resolved
Hide resolved
localization/ndt_scan_matcher/include/ndt_scan_matcher/ndt_scan_matcher_core.hpp
Outdated
Show resolved
Hide resolved
…to ndt_scan_matcher.cpp, fix README line Signed-off-by: Koki Aoki <[email protected]>
@YamatoAndo @KYabuuchi @SakodaShintaro
|
Description
Calculate 2D covariance (xx, xy, yx, yy) in real time using the convergence of NDT.
I limit the arrangement of multiple initial positions based on the Hessian matrix of the NDT score function.
Related links
original paper
Tests performed
I evaluated it In a tunnel evaluation (already shared in weekly meeting).
The real-time covariance estimation obtained the same convergence tendency as offline convergence evaluation.
Notes for reviewers
Related PRs:
Output Hessian matrix
Parameters for this covariance estaimtion
Interface changes
topic
/localization/pose_estimator/multi_ndt_pose
->NDT convergence positions
/localization/pose_estimator/multi_initial_pose
->NDT initial positions
yaml setting (ndt_scan_matcher.param.yaml)
Category: 2D Real-time covariance estimation (output_pose_covariance is the minimum value)
Default use_covariance_estimation is false.
Effects on system behavior
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.
[contribution guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/
[pull request guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/pull-request-guidelines/